﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Pixysoft.Framework.Noebe.Tools;
using Pixysoft.TestDrivens;

namespace Pixysoft.Framework.Noebe.testdriven
{
    class tc_004
    {
        public void testTableToEntity()
        {
            DataTable table = new DataTable("hello");
            table.Columns.Add("age");
            DataRow row = table.NewRow();
            row[0] = "1123";
            table.Rows.Add(row);
            Console.WriteLine(EntityHelper.DataTableToEntity<Hello>(table)[0].Age);
            EntityHelper.EntityToDataTable(EntityHelper.DataTableToEntity<Hello>(table).ToArray());
        }

        public void testEntityToTable()
        {
            NoebeConfiguration config = new NoebeConfiguration();
            config.DatabaseType = Pixysoft.Framework.XSchEmA.DatabaseType.Access;
            config.Filename = @"App_Code_.mdb";
            NoebeManager.Reload(config);


            Assert.Write(NoebeManager.Instance.SQLHelper.GetDuplicateData("SYS_SHOPBOXINFO", "BOXCODE"));
        }
    }

    public interface Hello : IEntityBase
    {
        int Age { get;set;}
    }
}
